package models

import (
	"time"
	"github.com/astaxie/beego/orm"
)

type Messages struct {
	Id           int64
	MessagesTime  time.Time `ht:"list;name(接收时间)"`
	SendId       int        `ht:"list;name(发送者Id)"`
	ReceiveId    int        `ht:"list;search;name(接收者Id)"`
	Type         int        `ht:"list;name(消息类型);subclass([{\"Num\":0,\"Name\":\"留言\"},{\"Num\":1,\"Name\":\"私信\"},{\"Num\":2,\"Name\":\"积分消息\"},{\"Num\":3,\"Name\":\"文章评论\"},{\"Num\":4,\"Name\":\"文章收藏\"},{\"Num\":5,\"Name\":\"订单消息\"},{\"Num\":6,\"Name\":\"审核消息\"}])"`
	MesageStatus int        `ht:"name(状态);status([{\"Num\":0,\"Name\":\"未读\"},{\"Num\":1,\"Name\":\"已读\"}])"`
	Addonfileds1 string    `orm:"column(addonfileds1);size(1000)" ht:"name(消息内容)"`
	Addonfileds2 int       `orm:"column(addonfileds2)" ht:"hide"`
	Addonfileds3 int       `orm:"column(addonfileds3)" ht:"hide"`
	Addonfileds4 string    `orm:"column(addonfileds4);size(1000)" ht:"hide"`
}


//type
//0 留言
//1 私信
//2 积分消息
//3 文章评论
//4 文章收藏
//5 订单消息
//6 审核消息
func init() {
	orm.RegisterModel(new(Messages))
}
func (*Messages)TableName() string {
	return "message"
}

func (*Messages) FN_Id() string {
	return "Id"
}
func (*Messages) FN_MessagesTime() string {
	return "MessagesTime"
}
func (*Messages) FN_SendId() string {
	return "SendId"
}
func (*Messages) FN_ReceiveId() string {
	return "ReceiveId"
}
func (*Messages) FN_Type() string {
	return "Type"
}
func (*Messages) FN_MesageStatus() string {
	return "MesageStatus"
}
func (*Messages) FN_Addonfileds1() string {
	return "Addonfileds1"
}
func (*Messages) FN_Addonfileds2() string {
	return "Addonfileds2"
}
func (*Messages) FN_Addonfileds3() string {
	return "Addonfileds3"
}
func (*Messages) FN_Addonfileds4() string {
	return "Addonfileds4"
}